/*
 * @Description: 订单管理相关 API
 * @Version: 1.0
 * @Author: Yuanjy
 * @Date: 2020-03-31 22:46:49
 * @LastEditors: Yuanjy
 * @LastEditTime: 2020-06-09 18:19:25
 */
import createAPI from '@/utils/axios'

const order = {
  // 源订单信息
  origin: {
    add: config => createAPI('/admin/v1/origin', 'POST', config),
    edit: config => createAPI('/admin/v1/origin', 'PUT', config),
    del: id => createAPI('/admin/v1/origin/' + id, 'DELETE', {}),
    detail: serviceId => createAPI('/admin/v1/origin/detail?service_id=' + serviceId, 'GET', {}),
    
    // 获取参数信息
    params: config => createAPI('/admin/v1/origin/params', 'GET', config),
    // 获取订单的数量
    getOriginNumber: config => createAPI('/admin/v1/origin/number', 'GET', config),
    // 导入订单
    import: config => createAPI('/admin/v1/origin/import', 'POST', config),
    // 分配订单
    distribute: config => createAPI('/admin/v1/origin/distribute', 'POST', config),
  },

  // 服务订单相关API
  service: {
    add: config => createAPI('/admin/v1/service', 'POST', config),
    edit: config => createAPI('/admin/v1/service', 'PUT', config),
    del: id => createAPI('/admin/v1/service/' + id, 'DELETE', {}),
    detail: serviceId => createAPI('/admin/v1/service/detail?service_id=' + serviceId, 'GET', {}),

    // 获取参数信息
    params: config => createAPI('/admin/v1/service/params', 'GET', config),

    // 获取视频信息
    orderVideo: serviceId => createAPI('/admin/v1/service/video-list?service_id=' + serviceId, 'GET', {}),
    // 获取测评信息
    evalInfo: serviceId => createAPI('/admin/v1/service/eval-info?service_id=' + serviceId, 'GET', {}),
    // 获取服务相关信息
    info: serviceId => createAPI('/admin/v1/service/info?service_id=' + serviceId, 'GET', {}),
    // 获取食谱信息
    recipe: serviceId => createAPI('/admin/v1/service/recipe?service_id=' + serviceId, 'GET', {}),
    // 获取一天的食谱信息
    getOneRecipe: config => createAPI('/admin/v1/service/day-recipe', 'GET', config),
    // 获取已有测评的列表
    getEvalList: config => createAPI('/admin/v1/service/eval-list', 'GET', config),
    // 获取自定义食谱的服务订单
    getCustomRecipeService: config => createAPI('/admin/v1/service/custom-service', 'GET', config),
    // 获取微课打卡记录
    getSeminarRecord: serviceId => createAPI('/admin/v1/service/seminar-record?service_id=' + serviceId, 'GET', {}),
    // 获取微任务信息
    getServiceMicro: serviceId => createAPI('/admin/v1/service/service-micro?service_id=' + serviceId, 'GET', {}),

    // 增删改单个食材信息
    modifyRecipe: config => createAPI('/admin/v1/service/recipe-modify', 'PUT', config),
    // 批量修改食材信息
    batchModifyRecipe: config => createAPI('/admin/v1/service/recipe-batch-modify', 'PUT', config),
    // 修改开始日期
    changeStartDate: config => createAPI('/admin/v1/service/change-start', 'PUT', config),
    // 修改服务状态
    changeBroken: config => createAPI('/admin/v1/service/change-broken', 'PUT', config),
    // 修改服务状态
    changeStatus: config => createAPI('/admin/v1/service/change-status', 'PUT', config),
    // 修改周期热量食谱
    changeRecipe: config => createAPI('/admin/v1/service/change-recipe', 'PUT', config),
    // 修改为自定义食谱
    changeDiyRecipe: config => createAPI('/admin/v1/service/change-diy-recipe', 'PUT', config),
    // 修改视频强度
    changeVideoType: config => createAPI('/admin/v1/service/change-video-type', 'PUT', config),
    // 修改备注信息
    changeRemark: config => createAPI('/admin/v1/service/change-remark', 'PUT', config),
    // 同步测评信息
    syncEval: config => createAPI('/admin/v1/service/sync-eval', 'PUT', config),
    // 复制自定义的食谱信息
    copyRecipe: config => createAPI('/admin/v1/service/copy-recipe', 'PUT', config),
    //修改测评的体重信息
    updateEvalWeight: config => createAPI('/admin/v1/service/update-eval-weight', 'PUT', config),
    //修改营养师信息
    updatePrincipal: config => createAPI('/admin/v1/service/update-principal', 'PUT', config),
    //修改减脂营信息
    updateCamp: config => createAPI('/admin/v1/service/update-camp', 'PUT', config),
    //通过或者重开微任务
    changeMicroStatus: config => createAPI('/admin/v1/service/change-micro-status', 'PUT', config),
  },

  //减脂营信息
  camp: {
    add: config => createAPI('/admin/v1/camp', 'POST', config),
    edit: config => createAPI('/admin/v1/camp', 'PUT', config),
    del: id => createAPI('/admin/v1/camp/' + id, 'DELETE', {}),
    detail: campId => createAPI('/admin/v1/camp/detail?camp_id=' + campId, 'GET', {}),

    //根据条件获取减脂营的服务订单信息
    getServiceList: config => createAPI('/admin/v1/camp/service-list', 'GET', config),
    //根据条件获取非减脂营服务订单信息
    getNoCampService: config => createAPI('/admin/v1/camp/no-camp-service', 'GET', config),
    //获取排行榜数据
    getRankData: config => createAPI('/admin/v1/camp/rank-data', 'GET', config),
    //获取可操作的减脂营信息
    getCampList: () => createAPI('/admin/v1/camp/camp-list', 'GET', {}),

    //同步群用户信息
    syncChatUser: config => createAPI('/admin/v1/camp/sync-chat-user', 'PUT', config),
    //设置开始时间
    setStartDate: config => createAPI('/admin/v1/camp/set-start-date', 'PUT', config),
    //设置食谱信息
    setRecipe: config => createAPI('/admin/v1/camp/set-recipe', 'PUT', config),
    //设置视频类型
    setSportType: config => createAPI('/admin/v1/camp/set-sport-type', 'PUT', config),
    //批量拉取订单到减脂营
    pullService: config => createAPI('/admin/v1/camp/pull-service', 'PUT', config),
  },

  //营销信息
  marketing: {
    //服务订单的营销信息
    info: serviceId => createAPI('/admin/v1/marketing/info?service_id=' + serviceId, 'GET', {}),
  },

  // 数据趋势相关API
  dataTrend: {
    //体重趋势信息
    getWeightData: config => createAPI('/admin/v1/data-trend/weight', 'GET', config),
    //获取运动的数据趋势
    getSportData: config => createAPI('/admin/v1/data-trend/sport', 'GET', config),
    //获取综合的数据趋势
    getTotalData: config => createAPI('/admin/v1/data-trend/total', 'GET', config),
    //获取饮食的数据趋势
    getDietData: config => createAPI('/admin/v1/data-trend/diet', 'GET', config),
    //获取饮水的数据趋势
    getDrinkData: config => createAPI('/admin/v1/data-trend/drink', 'GET', config),
    //获取睡眠的数据趋势（早起、入睡）
    getSleepData: config => createAPI('/admin/v1/data-trend/sleep', 'GET', config),
  }
}

export default order